<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <th:block th:include="include/include :: header('选择部门')" />
    <!--[if IE 8]><!-->
    <style type="text/css">.search-collapse{display: block !important}</style>
    <!--<![endif]-->
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
           <div class="col-sm-12 search-collapse">
               <form id="formId">
                   <div class="select-list">
                       <ul>
                           <li>
									登录名称：<input type="text" name="loginname"/>
								</li>
								<li>
									手机号码：<input type="text" name="phone"/>
								</li>
                           <li>
                               <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                               <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                           </li>
                       </ul>
                   </div>
               </form>
           </div> 
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include/include :: footer" />
    <script th:inline="javascript">
        var userIds;
        function initData(initData) {
            userIds = initData
            initTable()
        }
    	function initTable() {
            var options = {
                url: ctx + 'admin/user/page',
                columns: [{
                    checkbox: true,
                    formatter: function(value, row, index) {
                        if(userIds.indexOf(row.userId) >= 0) {
                            return {
                                checked: true
                            }
                        }
                    }
                },
                    {
                        field: 'loginname',
                        title: '登录名'
                    },
                    {
                        field: 'username',
                        title: '用户名'
                    },
                    {
                        field: 'phone',
                        title: '手机号'
                    },
                    {
                        field: 'email',
                        title: '邮箱'
                    }
                ]
            };
            $.table.init(options);
        }
    </script>

</body>
</html>